package emulator.hardware.nmos6502;

import java.util.HashMap;
import java.util.Map.Entry;

public class BreakPoints {
	private HashMap<Integer, Boolean> breakpoints;

	public BreakPoints()
	{
		this.breakpoints = new HashMap<Integer, Boolean>();
	}

	public boolean checkBreak(int number)
	{
		return breakpoints.containsKey(number);
	}

	public void addBreak(int number) {
		breakpoints.put(number, true);
	}

	public void removeBreak(int number) {
		breakpoints.remove(number);
	}

	public void clearAllStops() {
		HashMap<Integer,Boolean> cleared_map = new HashMap<Integer,Boolean>();
		for (Entry<Integer, Boolean> entry : breakpoints.entrySet())
		{
			if (entry.getValue())
				cleared_map.put(entry.getKey(), entry.getValue());
		}
		breakpoints = cleared_map;
	}

	public void addStop(int number) {
		breakpoints.put(number, false);
	}

}